/**
 * 
 * 启迪科技 Copyright (c) 2014-2018 PingAnFu,Inc.All Rights Reserved.
 */
package cn.qidisoft.edu.hzjt.constants;

import cn.qidisoft.core.util.StringUtils;

/**
 * OPS系统内部异常code定义
 * 
 * @author huanghui951
 * @version $Id: OPSErrorCode.java, v 0.1 2016年3月29日 下午7:49:09 huanghui951 Exp $
 */
public enum OpsErrorCode {
  OPS_000000("OPS_000000", "成功"), //

  /**
   * call remote service code 03****
   */
  /** RPC URL不存在 */
  OPS_030001("OPS_030001", "RPC URL不存在"), //
  /** RPC连接超时 */
  OPS_030002("OPS_030002", "RPC连接超时"), //
  /** 无权限访问服务 */
  OPS_030003("OPS_030003", "无权限访问服务"), //
  /** 服务方业务异常 */
  OPS_030004("OPS_030004", "服务方业务异常"), //
  /** RPC调用方法时响应超时 */
  OPS_030005("OPS_030005", "RPC调用方法时响应超时"), //
  /** 远程服务异常 */
  OPS_030006("OPS_030006", "远程服务异常"), //
  /** RPC网络异常 */
  OPS_030007("OPS_030007", "RPC网络异常"), //
  /** RPC时序列化异常 */
  OPS_030008("OPS_030008", "RPC时序列化异常"), //
  /** RPC参数错误 */
  OPS_030009("OPS_030009", "RPC参数错误"), //

  ;
  private String code;

  private String msg;

  private OpsErrorCode(String code, String msg) {
    this.code = code;
    this.msg = msg;
  }



  public static OpsErrorCode getOpsErrorCode(String code) {
    for (OpsErrorCode errorCode : OpsErrorCode.values()) {
      if (!StringUtils.isNullValue(code) && StringUtils.equals(code, errorCode.getCode())) {
        return errorCode;

      }
    }
    return null;
  }

  /**
   * Getter method for property <tt>code</tt>.
   * 
   * @return property value of code
   */
  public String getCode() {
    return code;
  }

  /**
   * Setter method for property <tt>code</tt>.
   * 
   * @param code value to be assigned to property code
   */
  public void setCode(String code) {
    this.code = code;
  }

  /**
   * Getter method for property <tt>msg</tt>.
   * 
   * @return property value of msg
   */
  public String getMsg() {
    return msg;
  }

  /**
   * Setter method for property <tt>msg</tt>.
   * 
   * @param msg value to be assigned to property msg
   */
  public void setMsg(String msg) {
    this.msg = msg;
  }

}
